# include <stdio.h>
# include <sys/stat.h>
# include <fcntl.h>
# define uchar unsigned char
# define uint unsigned int
# include <unistd.h>
int open_jugg(int i)
{
	//char *j = "oepn_parm";
	//printf("%s=%d\n",j,i);
	if (i< 0)
	{
		//printf("failure\n");
		return 0;
	}
	else
	{
		//printf("success\n");
		return 1;
	}
}

int sum_add(int i,int j)
{
	int sum = i+j;
	return sum;
}

int main(void)
{
	int i = open("./2.txt",O_RDWR|O_CREAT,666);
	int j = open("./3.txt",O_RDWR|O_CREAT,666);
	printf("%d\n",sum_add(i,j));
	printf("i=");
	printf("%d\n",open_jugg(i));
	printf("j=");
	printf("%d\n",open_jugg(j));
	uchar buf[100];
	read(i,buf,100);
	printf("%s\n",buf);
	// uchar buff[7] = {"7654321"};
	// lseek(i,1,SEEK_SET);
	
	write(j,buf,7);
	close(i);
	close(j);
	
	
	
	return 0;
}